package br.com.ava.core.editora;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.PrimaryKeyJoinColumn;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;

import br.com.ava.core.pessoa.PessoaJuridica;

@Entity
@Table(name = "editora")
@PrimaryKeyJoinColumn(name = "idpessoa")
@SuppressWarnings("serial")
public class Editora extends PessoaJuridica {

	private Integer idEditora;

	public Editora(String nome, String telefone, String email, String endereco,
			String razaoSocial, String cnpj) {
		super(nome, telefone, email, endereco, razaoSocial, cnpj);
		this.idEditora = 0;
	}

	public Editora() {
		this.idEditora = 0;
	}

	@SequenceGenerator(name = "ideditora_seq", sequenceName = "ideditora_seq", allocationSize = 1)
	@GeneratedValue(strategy = GenerationType.AUTO, generator = "ideditora_seq")
	@Column(name = "ideditora", nullable = true)
	public Integer getIdEditora() {
		return idEditora;
	}

	public void setIdEditora(Integer idEditora) {
		this.idEditora = idEditora;
	}

	@Override
	public String toString() {
		return getNome();
	}
}
